package com.wiscamp.ninechapters.problems.infrastructure.mappers.misc;

import com.wiscamp.ninechapters.problems.infrastructure.po.misc.ArticlePO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.Collection;

@Repository
@Deprecated
public interface ArticleMapper extends JpaRepository<ArticlePO, Long>, JpaSpecificationExecutor<ArticlePO> {

    @Query(value = "select e from ArticlePO e where e.active = true order by e.publishTime desc")
    Collection<ArticlePO> findArticles();
}